import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/layout'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '',
      component: Layout,
      redirect: '/index',
      children: [
        {
          path: '/index',
          component: () => import('@/views/module2/section1/page1'),
          name: 'Index',
          meta: { title: '页面1' }
        }
      ]
    },
    {
      path: '/login',
      component: () => import('@/views/login/login.vue')

    }
  ]
})
// 动态路由，基于用户权限动态去加载
export const dynamicRoutes = [
  // {
  //   path: "/system",
  //   name: "system",
  //   permissions: ['system:user:menu'],
  //   meta: {
  //       title: '系统',
  //       icon: "Operation"
  //   },
  //   component: Layout,
  //   children: [
  //     {
  //       path: "/organize",
  //       name: "organize",
  //       meta: {
  //           title: '组织架构',
  //           icon: "Coin"
  //       },
  //       redirect:'/system/organize/menu',
  //       children:[
  //         {
  //             path: "/system/organize/menu",
  //             name: "menu",
  //             component: () => import('@/views/system/menu'),
  //             meta: {
  //                 title: '菜单管理',
  //                 icon: "Coin"
  //             }
  //         },
  //       ]
  //     }
  //   ]
  // }
]
export default router
